#ifndef LOGINREQUEST_H
#define LOGINREQUEST_H
#include "request.h"
#include <QObject>
#include <QDebug>
#include <QJsonObject>
#include <QJsonDocument>
struct LoginInfo{
    int code;
    QString token;
    QString message;
};

class LoginRequest : public QObject
{
    Q_OBJECT
public:

    static LoginRequest *ptrLoginRequest;
    static LoginRequest *getinstance()
    {
        if(nullptr == ptrLoginRequest)
        {
            ptrLoginRequest = new LoginRequest;
        }
        return ptrLoginRequest;
    }

    explicit LoginRequest(QObject *parent = nullptr);
    struct LoginInfo loginInfo;
    LoginInfo getLoginInfo(QString username,QString pwd);

signals:
    void LoginByPasswordSuccess();
private:
    Request *m_r;

};

#endif // LOGINREQUEST_H
